home *** CD-ROM | disk | FTP | other *** search
- Path: chewy.vcx.net!usenet
- From: Bruce Arnold <barnold@vcx.net>
- Newsgroups: comp.lang.c,comp.std.c,comp.lang.c++
- Subject: Re: Floating Point arithmetic problem
- Date: Thu, 15 Feb 1996 22:39:16 -0800
- Organization: Sprint United Telephone/Eastern - Internet @ccess
- Message-ID: <31242694.2825@vcx.net>
- References: <c968da6jzm.fsf@damayanti.india.ti.com>
- NNTP-Posting-Host: y-wing-2a-32.tatooine.vcx.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win16; I)
-
- > wierd problem with floating point arithmetic on the SUN 4.1.x platform.
- > The insignificant digits (floating point) keep accruing ......
- > Plan A: Forget about floating point numbers. Scale the problem and use integers.
- Plan B: Add a small value, say 0.00000001, so that you never get into the
- 9999999999999... problem. Then use your "scale", "convert to int", "re-scale"
- solution to "round off" the unwanted junk.
- ...Bruce
-